﻿using QMERP.SeedWork;

namespace QMERP.Domain.Entities
{
    /// <summary>
    /// 批量订单
    /// </summary>
    public class BulkOrder : FullEntity<long>
    {
        public BulkOrder()
        {
            BulkOrderDetails = new HashSet<BulkOrderDetail>();
        }
        /// <summary>
        /// 类型
        /// </summary>
        public string Type { get; set; } = "";
        /// <summary>
        /// 批量订单号
        /// </summary>
        public string Number { get; set; } = "";
        /// <summary>
        /// 客户单号
        /// </summary>
        public string CustomerOrderNumber { get; set; } = "";
        /// <summary>
        /// 公司订单编号
        /// </summary>
        public string OrderRef { get; set; } = "";
        /// <summary>
        /// 交收单号
        /// </summary>
        public string? TrayNumber { get; set; }
        /// <summary>
        /// 预出货日期
        /// </summary>
        public DateTime? DeliveryOn { get; set; }
        /// <summary>
        /// 出货时段
        /// </summary>
        public int OutRank { get; set; }
        /// <summary>
        /// 状态
        /// </summary>
        public string Status { get; set; } = "";
        /// <summary>
        /// 发票打印时间
        /// </summary>
        public DateTime? InvoicePrintOn { get; set; }
        /// <summary>
        /// 审核人Id
        /// </summary>
        public long? CheckedBy { get; set; }
        /// <summary>
        /// 审核人
        /// </summary>
        public string? CheckedByName { get; set; }
        /// <summary>
        /// 审核时间
        /// </summary>
        public DateTime? CheckedOn { get; set; }
        /// <summary>
        /// 完成人Id
        /// </summary>
        public long? FinishedBy { get; set; }
        /// <summary>
        /// 完成人名称
        /// </summary>
        public string? FinishedByName { get; set; }
        /// <summary>
        /// 完成时间
        /// </summary>
        public DateTime? FinishedOn { get; set; }
        /// <summary>
        /// 备注
        /// </summary>
        public string? Remark { get; set; }

        /// <summary>
        /// 客户Id
        /// </summary>
        public long CustomerId { get; set; }
        /// <summary>
        /// 合约Id
        /// </summary>
        public long ContractId { get; set; }
        /// <summary>
        /// 客户
        /// </summary>
        public virtual Customer? Customer { get; set; }
        /// <summary>
        /// 合约
        /// </summary>
        public virtual Contract? Contract { get; set; }
        /// <summary>
        /// 订单详情列表
        /// </summary>
        public virtual ICollection<BulkOrderDetail> BulkOrderDetails { get; set; }
    }
}
